Remove default OpenJDK
1
sudo apt-get purge openjdk-\*
download jdk(containing jre) and tar.
add into /etc/profile
1
2JAVA_HOME="/home/newly/Program_Files/Java/jdk1.8.0_65"
PATH="$PATH:$JAVA_HOME/jre/bin:$JAVA_HOME/bin"set newly installed jdk as default jdk.
1
2
3sudo update-alternatives --install "/usr/bin/java" "java" "$JAVA_HOME/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "$JAVA_HOME/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "$JAVA_HOME/bin/javaws" 1